<template>
  <el-aside width="225px">
    <el-menu background-color="#333744" text-color="#fff" active-text-color="#333744" router>
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>用户管理</span>
        </template>
        <el-menu-item v-for="(item,i) in navList1" :key="i" :index="item.navItem">{{item.name}}</el-menu-item>
      </el-submenu>
      <el-submenu index="2" class="submenu">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>课程管理</span>
        </template>
        <el-menu-item v-for="(item,i) in navList2" :key="i" :index="item.navItem">{{item.name}}</el-menu-item>
      </el-submenu>
    </el-menu>
  </el-aside>
</template>

<script>
export default {
  data() {
    return {
        // navItem放要跳转的路径
      navList1: [
        { name: "教师信息列表", navItem: "/teacherInfo" },
        { name: "学生信息列表", navItem: "/stuInfo" }
      ],
      navList2: [
        { name: "课程信息列表", navItem: "/courseInfo" },
        { name: "新增课程信息列表", navItem: "/addCourse" }
      ]
    };
  },
  methods: {}
};
</script>

<style scoped>
.el-menu {
  color: white;
}

.el-menu-item {
  background-color: #f2f6fc !important;
  color: black !important;
  border-bottom: 1px solid #333744;
}

.el-menu-item.is-active {
  color: #409bff !important;
}
</style>